-
Notifications
You must be signed in to change notification settings - Fork 0
Implement XML-driven custom property system for TombEngine moveables and statics #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
|
@copilot I get following error Severity Code Description Project File Line Suppression State Details |
Fixed in commit 702595b. The compilation errors were caused by:
Changed the dictionary and method signatures from |
|
@copilot More errors Severity Code Description Project File Line Suppression State Details |
|
@copilot When i build release its not copying the default property xml files or the windows directory to build directory. Also when I click edit object for static, it just opens a color picker and not the property window. |
Fixed in commits f083cfd and 38157fc: XML files not copying to build directory:
XML file lookup not working:
Static objects opening color picker instead of property window:
The property system should now work correctly for both moveables and statics in TombEngine levels. |
|
@copilot Can we change the layout of the property window to a property grid. The description text can be on ToolTip. Item Name Property 1 - Value 1 |
Implemented in commit 4060bfb. The property window now uses a property grid layout with: Grid Layout:
Color Picker:
The interface is now much cleaner and more professional, similar to standard property grids in Visual Studio or other IDEs. |
Fixed in commit de14027. ObjectDisposedException Issue: Solution:
Compilation Error (CS0136): The property system should now work without crashes when editing properties. |
Fixed in commit dd52a92. The NullReferenceException occurred because the XAML sliders and textboxes have default values that trigger ValueChanged/TextChanged events during InitializeComponent(), but not all named controls are fully loaded yet when these events fire. Added null checks at the start of all three event handlers to safely ignore events during initialization. The color picker now opens without errors. |
|
@copilot Also, for some reason all multi mesh moveables are broken in the editor window. They are not showing the first animation frame anymore. Not sure what could be causing it. Is it cause we added Property to moveable instance? |
…s to Items menu Co-authored-by: TrainWrack <120750885+TrainWrack@users.noreply.github.com>
Co-authored-by: TrainWrack <120750885+TrainWrack@users.noreply.github.com>
…ing operator precedence Co-authored-by: TrainWrack <120750885+TrainWrack@users.noreply.github.com>
Co-authored-by: TrainWrack <120750885+TrainWrack@users.noreply.github.com>
… for GetObjectSetupWindow
Co-authored-by: TrainWrack <120750885+TrainWrack@users.noreply.github.com>
Overview
Adds comprehensive custom property system for TombEngine objects. Properties defined in XML, edited via unified UI, serialized to WAD2/PRJ2, and inherited from WAD to level instances.
Core Architecture
Property Definition Layer
Resources/Properties/Moveables/*.xmldefine per-object propertiesDefault.xmlprovides base properties (HP, OCB) merged with object-specific definitionsPropertyManagersingleton loads and caches all definitions at startupUI Layer
PropertyEditorWindowdynamically builds controls from property definitionsColorPickerWindowfor RGB/hex color editingPersistence Layer
Wad2Writer/Loader: Serialize CustomProperties to WAD2 binary formatPrj2Writer/Loader: Serialize CustomProperties to PRJ2 level format["item1","item2"]PropertyCollection.GetProperty<T>Integration
ItemInstance.FromItemType()copies properties from WAD to instance on placementGetObjectSetupWindow()routes to appropriate form based on level typeKey Implementation Details
Property Inheritance Flow
Level Type Routing
Checkbox Serialization
Files Changed
Core Classes (new)
PropertyDefinition.cs,PropertyCollection.cs,PropertyManager.csPropertyEditorWindow.xaml/.cs,ColorPickerWindow.xaml/.csSerialization (modified)
Wad2Writer.cs,Wad2Loader.cs- WAD2 binary chunksPrj2Writer.cs,Prj2Loader.cs- PRJ2 level chunksData Model (modified)
WadMoveable.cs,WadStatic.cs- AddedCustomPropertiesfieldMoveableInstance.cs,StaticInstance.cs- AddedCustomPropertiesfieldItemInstance.cs- Property copying inFromItemType()UI Integration (modified)
EditorActions.cs- Routing logic, bulk operationsFormMain.cs(WadTool) - Context menu, PropertyManager initFormMoveable.cs,FormStatic.cs(TombEngine namespace) - Use PropertyEditorWindowBackward Compatibility
TR4/NG levels unaffected. Conditional routing based on
Level.IsTombEngine:Documentation
PROPERTY_SYSTEM.md- User guide (782 lines)PROPERTY_SYSTEM_ARCHITECTURE.md- Technical architecture with data flow diagrams (783 lines)Original prompt
Requirements for Property System in Tomb Editor
Overview
This document defines the requirements for implementing a WPF-based property system in Tomb Editor. The system is designed for the Tomb Engine level type, managing properties for both moveables and statics. Moveables and statics will have distinct property models to reflect their usage in the engine.
Functional Requirements
1. Property Management for Moveables
1.1 Each moveable item has an associated XML file that describes its properties.
1.2 The property system allows users to:
2. Property Management for Statics
2.1 All statics share a single XML file that lists common and dynamic properties.
2.2 Default properties for statics should include:
trueorfalse).2.3 Additional properties for statics (beyond the defaults) should be read dynamically from the shared static property XML file.
3. Dynamic Properties and Controls
Controls for properties (both moveables and statics) should be dynamically defined based on the XML files.
3.1 Supported control types:
3.2 Each property must include:
4. Default Settings and Reset Option
4.1 When the property window opens for the first time, it should load default properties for the selected moveable or static.
4.2 The property window must enable users to reset all properties to their defaults via a Reset to Default button.
5. Mandatory Properties
For Moveables:
5.1 Every moveable item will have two mandatory default properties:
For Statics:
5.2 Every static item will have the following default properties:
Non-Functional Requirements
1. UI/UX
1.1 The property window must be built using WPF, leveraging a modern and responsive UI framework.
1.2 The design should allow seamless interaction and efficient batch updates for users.
Architectural Requirements
1. Binding to XML
1.1 Moveable properties:
1.2 Static properties:
1.3 General structure of the XML files:
2. Dynamic Property Loading
2.1 For both moveables and statics, the system should dynamically load property definitions from their respective XML files to populate the property editor UI.
3. Batch Updates
3.1 The system must support batch updates for moveables and statics, ensuring multiple objects of the same type can be updated in a single action.
Example XML Structures
Example 1: Moveable Properties XML
Example 2: Shared Static Properties XML
Future Considerations
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.